package com.zdyg.inputtask.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zdyg.inputtask.project.entity.BOrderTerraceItem;
import com.zdyg.inputtask.project.mapper.BOrderTerraceItemMapper;
import com.zdyg.inputtask.project.service.IBOrderTerraceItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 订单平台端子表 服务实现类
 * </p>
 *
 * @author ANGE
 * @since 2019-12-12
 */
@Service
public class BOrderTerraceItemServiceImpl extends ServiceImpl<BOrderTerraceItemMapper, BOrderTerraceItem> implements IBOrderTerraceItemService {

    @Autowired
    private BOrderTerraceItemMapper orderTerraceItemMapper;
    @Autowired
    private HttpServletRequest request;

    @Override
    public void getSaasOrders() {
        BOrderTerraceItem orderTerraceItem = new BOrderTerraceItem();
        List<BOrderTerraceItem> orders = orderTerraceItemMapper.selectList(new QueryWrapper<BOrderTerraceItem>(orderTerraceItem)
                .lambda()
                .gt(BOrderTerraceItem::getTendererTime, new Date())
                .eq(BOrderTerraceItem::getTradeStatus,1));

        if(orders!=null){
            request.setAttribute("saas",orders);
            System.out.println(orders);
        }
    }
}
